// 文件位置: src/main/java/com/pharmacy/SaleManage/entity/SaleRecord.java
package com.pharmacy.SaleManage.entity;

import com.pharmacy.MedicineManage.entity.Medicine;
import com.pharmacy.UserManage.entity.User;

import java.util.Date;

public class SaleRecord {
    private Integer id;
    private Integer medicineId;
    private Integer quantity;
    private Double totalAmount;
    private Date saleTime;
    private Integer operatorId;
    private Medicine medicine; // 关联药品信息
    private User operator; // 关联操作员信息

    // 构造方法
    public SaleRecord() {}

    public SaleRecord(Integer medicineId, Integer quantity, Double totalAmount, Integer operatorId) {
        this.medicineId = medicineId;
        this.quantity = quantity;
        this.totalAmount = totalAmount;
        this.operatorId = operatorId;
        this.saleTime = new Date();
    }

    // Getter和Setter方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public Integer getMedicineId() { return medicineId; }
    public void setMedicineId(Integer medicineId) { this.medicineId = medicineId; }

    public Integer getQuantity() { return quantity; }
    public void setQuantity(Integer quantity) { this.quantity = quantity; }

    public Double getTotalAmount() { return totalAmount; }
    public void setTotalAmount(Double totalAmount) { this.totalAmount = totalAmount; }

    public Date getSaleTime() { return saleTime; }
    public void setSaleTime(Date saleTime) { this.saleTime = saleTime; }

    public Integer getOperatorId() { return operatorId; }
    public void setOperatorId(Integer operatorId) { this.operatorId = operatorId; }

    public Medicine getMedicine() { return medicine; }
    public void setMedicine(Medicine medicine) { this.medicine = medicine; }

    public User getOperator() { return operator; }
    public void setOperator(User operator) { this.operator = operator; }
}